﻿using Microsoft.Xna.Framework;
using Syngine;
using Syngine.Input;
using Syngine.Components.Screens;
using Syngine.Controls;

namespace BenchMark
{
	public class BenchMarkPauseScreen : PauseScreen
	{
		private readonly Button _button = new Button();

		protected override void PostDrawCore(DrawContext context)
		{
			_button.Draw(context);
		}

		public override void Initialize()
		{
			_button.AssetName = "Controls\\Button";

			_button.Initialize();
			_button.IsPausable = false;
			_button.Position = new Vector2(500);

			_button.Click += BackButtonOnClick;

			base.Initialize();
		}

		private void BackButtonOnClick(InputCallbackContext context)
		{

		}

		public override void LoadContent(LoadContext context)
		{
			_button.LoadContent(context);
			_button.LoadContent(context, ControlState.Clicked);
			_button.LoadFont(context, "spriteFont1");
		}

		public override void UnloadContent()
		{
			_button.UnloadContent();
		}

		protected override void UpdateCore(UpdateContext context)
		{
			_button.Update(context);
		}
	}
}